Skip to content

dtls13: add check over handshake message length#10769

Merged
SparkiDev merged 2 commits into
wolfSSL:masterfrom
rizlik:dtls13_max_handshake_sz
Jul 23, 2026
Merged

dtls13: add check over handshake message length#10769
SparkiDev merged 2 commits into
wolfSSL:masterfrom
rizlik:dtls13_max_handshake_sz

Conversation

@rizlik

@rizlik rizlik commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings June 24, 2026 17:31
@rizlik rizlik self-assigned this Jun 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a DTLS 1.3 safety check to prevent buffering/reassembly of unauthenticated handshake fragments that claim an excessive message_length, and introduces a regression test to ensure oversized plaintext handshake messages are dropped rather than stored.

Changes:

  • Add a MAX_HANDSHAKE_SZ cap check in src/dtls13.c before buffering handshake fragments for reassembly.
  • Add a new DTLS 1.3 memio test that spoofs a plaintext ServerHello handshake message_length to exceed MAX_HANDSHAKE_SZ and asserts nothing is buffered.
  • Register the new test in the DTLS API test declarations.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/api/test_dtls.h Declares and registers the new DTLS 1.3 oversized handshake-length test.
tests/api/test_dtls.c Adds a memio-based regression test that injects an oversized plaintext handshake fragment and checks it isn’t buffered.
src/dtls13.c Caps DTLS 1.3 handshake messageLength prior to fragment buffering; drops oversized plaintext messages and errors on oversized encrypted ones.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/dtls13.c
@rizlik
rizlik force-pushed the dtls13_max_handshake_sz branch from 0132f13 to 06a6714 Compare June 29, 2026 11:33
@rizlik
rizlik force-pushed the dtls13_max_handshake_sz branch 2 times, most recently from 3dcd90f to 028a407 Compare July 20, 2026 08:20
@rizlik
rizlik requested a review from julek-wolfssl July 23, 2026 07:26
@rizlik rizlik assigned julek-wolfssl and unassigned rizlik Jul 23, 2026
@SparkiDev SparkiDev self-assigned this Jul 23, 2026

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #10769

Scan targets checked: wolfcrypt-rs-bugs, wolfssl-bugs, wolfssl-src

No new issues found in the changed files. ✅

@SparkiDev
SparkiDev merged commit 98edc78 into wolfSSL:master Jul 23, 2026
341 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants